from django.contrib.auth.models import User
from django.db import models


# Create your models here.
class Video(models.Model):
    user = models.ForeignKey(User, related_name='user_videos', on_delete=models.CASCADE)

    title = models.CharField(max_length=64)
    size = models.CharField(max_length=16)
    duration = models.FloatField()

    url = models.FileField(upload_to='videos/')
    cover = models.FileField(upload_to='photos/')

    create_date = models.DateTimeField(auto_now_add=True)

    def __unicode__(self):
        return self.title
